<?php
	header("content-type:text/html;charset=utf8");
	$goods_name = isset($_POST['goods_name'])?$_POST['goods_name']:"";
	$goods_password= isset($_POST['goods_password'])?$_POST['goods_password']:"";
	$dsn = "mysql:host=127.0.0.1;dbname=07c;charset=utf8";
	$pdo = new PDO($dsn,'root','root');
	$sql ="insert into goods (goods_name,goods_password) values ('$goods_name','$goods_password')";
	//var_dump($sql);die;
	$res = $pdo->exec($sql);
	if($res)
	{
		echo "<script>alert('添加成功');location.href='daoc.php'</script>";
	}
	?>
